﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.Composite.Regions;

namespace RentAWorker.Management.Infrastructure
{
    public static class RegionManagerHelper
    {
        public static void Activate(this IRegionManager manager, string regionName, object view)
        {
            manager.Regions[regionName].Activate(view);
        }

        public static void Clear(this IRegion region)
        {
            IViewsCollection collection = region.Views;
            while(collection.Count() > 0)
            {
                region.Remove(collection.First());
            }
        }
    }
}
